import Mock from 'mockjs'

const newsList = Mock.mock('/sys/news/list', 'get', {
  code: 200,
  msg: 'success',
  data: {
    totalCount: 0,
    pageSize: 10,
    currPage: 1,
    totalPage: '@integer(10,50)',
    'list|10': [{
      'id|+1': 1,
      title: '@title()',
      introduction: '@cparagraph()',
      content: '@paragraph(1,3)',
      author: '@cname()',
      release_date: '@date()',
      status: '@integer(0,1)',
      'newsType|1-10': '@cname'
    }
    ]
  }
})

const deleteNews = Mock.mock('sys/news/delete', 'delete', {
  code: 200,
  message: 'success'
})

const newsUpdate = Mock.mock('/sys/news/update', 'post', {
  code: 200,
  message: 'success'
})

const newsTypeList = Mock.mock('/sys/news/type/list', 'get', {
  code: 200,
  message: 'success',
  data: {
    totalCount: 0,
    pageSize: 10,
    currPage: 1,
    totalPage: '@integer(10,50)',
    'list|10': [{
      'id|+1': 1,
      typeName: '@cname'
    }
    ]
  }
})

const newsTypeUpdate = Mock.mock('/sys/news/type/update', 'post', {
  code: 200,
  message: 'success'
})

const newsTypeDelete = Mock.mock('/sys/news/type/delete', 'delete', {
  code: 200,
  message: 'success'
})

const adList = Mock.mock('/sys/banner/list', 'get', {
  code: 200,
  msg: 'success',
  data: {
    totalCount: 0,
    pageSize: 10,
    currPage: 1,
    totalPage: '@integer(10,50)',
    'list|10': [{
      'id|+1': 1,
      name: '@name()',
      url: '@url()',
      src: '@url()',
      sort_num: '@integer(0,x)',
      type: '@integer(1,2)',
      status: '@natural(0,1)'
    }
    ]
  }
})

const deleteAd = Mock.mock('/sys/banner/list/delete', 'delete', {
  code: 200,
  message: 'success'
})

const adUpdate = Mock.mock('/sys/banner/update', 'post', {
  code: 200,
  message: 'success'
})

const vipList = Mock.mock('/sys/vip/list', 'get', {
  code: 200,
  msg: 'success',
  data: {
    totalCount: 0,
    pageSize: 10,
    currPage: 1,
    totalPage: '@integer(10,50)',
    'list|10': [{
      'vipId|+1': 1,
      sex: '@character("男女")',
      birthday: '@datetime()',
      nickname: '@name()',
      avatar: '@name()',
      city: '@county(true)',
      phone: '@integer(15,60)',
      job: '@integer(15,60)',
      status: '@natural(0,1)'
    }
    ]
  }
})

const deleteVip = Mock.mock('sys/vip/delete', 'delete', {
  code: 200,
  message: 'success'
})

const vipInfo = Mock.mock('/sys/vip/info', 'get', {
  code: 200,
  msg: 'success',
  data: {
    totalCount: 0,
    pageSize: 10,
    currPage: 1,
    totalPage: '@integer(10,50)',
    'list|10': [{
      'id|+1': 1,
      sex: '@character("男女")',
      birthday: '@datetime()',
      nickname: '@name()',
      avatar: '@name()',
      city: '@county(true)',
      phone: '@integer(15,60)',
      job: '@integer(15,60)',
      status: '@natural(0,1)'
    }
    ]
  }
})

const vipStatus = Mock.mock('/sys/vip/status', 'post', {
  code: 200,
  message: 'success'
})

const collectMovie = Mock.mock('/sys/collect/movie', 'get', {
  code: 200,
  msg: 'success',
  data: {
    totalCount: 0,
    pageSize: 10,
    currPage: 1,
    totalPage: '@integer(10,50)',
    'list|10': [{
      'id|+1': 1,
      name: '@cname',
      translationName: '@word',
      introduction: '@cparagraph',
      releaseDate: '@date(yyyy-MM-dd)-@date(yyyy-MM-dd)',
      movieStatus: '@integer(0,2)',
      status: '@integer(0,1)'
    }]
  }
})

export {
  newsList,
  deleteNews,
  newsUpdate,
  newsTypeList,
  newsTypeUpdate,
  newsTypeDelete,
  adList,
  deleteAd,
  adUpdate,
  vipList,
  deleteVip,
  vipInfo,
  vipStatus,
  collectMovie
}
